Skip to content

Sync markdown#952

Merged
mk-mxp merged 9 commits intoexercism:mainfrom
Narkunan:sync-markdown
Apr 20, 2026
Merged

Sync markdown#952
mk-mxp merged 9 commits intoexercism:mainfrom
Narkunan:sync-markdown

Conversation

@Narkunan
Copy link
Copy Markdown
Contributor

@Narkunan Narkunan commented Apr 18, 2026

Fix issue #922

@github-actions
Copy link
Copy Markdown

This PR touches files which potentially affect the outcome of the tests of an exercise. This will cause all students' solutions to affected exercises to be re-tested.

If this PR does not affect the result of the test (or, for example, adds an edge case that is not worth rerunning all tests for), please add the following to the merge-commit message which will stops student's tests from re-running. Please copy-paste to avoid typos.

[no important files changed]

For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping @exercism/maintainers-admin in a comment. Thank you!

@mk-mxp mk-mxp self-requested a review April 19, 2026 08:08
@mk-mxp mk-mxp added x:action/sync Sync content with its latest version x:knowledge/elementary Little Exercism knowledge required x:module/practice-exercise Work on Practice Exercises x:type/content Work on content (e.g. exercises, concepts) x:size/small Small amount of work x:rep/small Small amount of reputation labels Apr 19, 2026
Copy link
Copy Markdown
Contributor

@mk-mxp mk-mxp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need to dig deeper into the commented out tests. It may take me a day or two, so please be patient. Thanks a lot for helping!

Comment thread exercises/practice/markdown/Markdown.php
Comment thread exercises/practice/markdown/MarkdownTest.php
@mk-mxp
Copy link
Copy Markdown
Contributor

mk-mxp commented Apr 19, 2026

@Narkunan I'm sorry, but this change is getting a bit harder. I hope you can understand what I'm asking for:

  1. In the existing tests, the translation of _italics_ and __bold__ to HTML has changed from <i> / <em> to <em> / <strong>. It should be relatively easy to do, once you see it in code. Look at the tests 69a4165d-9bf8-4dd7-bfdc-536eaca80a6a, ec345a1d-db20-4569-a81a-172fe0cad8a1, 51164ed4-5641-4909-8fab-fbaa9d37d5a8, and 7bf92413-df8f-4de8-9184-b724f363c3da in canonical-data.json and adjust our test file accordingly. Of course, you also need to adjust the example file .meta/example.php and the student's file Markdown.php to make the tests pass again. This change already makes all existing solutions fail, but I think it is worth doing so.
  2. The next challenge is to add the new tests and make them pass - which also breaks all solutions. This is not straight forward, as the code given to the students intentionally is bloated and convoluted.
    • First change the single quotes ' on the input values inside parseMarkdown() to double quotes ". In PHP the character sequence \n is not a LINEFEED when put into single quotes. It's best to have all parseMarkdown() invocations use the same quoting style, but at least tests 113a2e58-78de-4efa-90e9-20972224d759 and f0bbbbde-0f52-4c0c-99ec-be4c60126dd4 are required.
    • Then make the new tests pass. I have prepared the required changes to the student's and example files to fix the code but keep the ugliness. You are welcome to do that on your own!
  3. As a last and optional step it makes sense to format all tests identically. Break all $this->assertEquals(); to multiple lines, as you did for the new tests already.

Well, yes, sorry again. I haven't seen all this when I classified the issue as "good first issue". That is a lot of exceptional stuff to do...

Copy link
Copy Markdown
Contributor

@mk-mxp mk-mxp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope the new GitHub pull request feature for commenting on unchanged lines works as expected 😃

Comment thread exercises/practice/markdown/Markdown.php Outdated
Comment thread exercises/practice/markdown/Markdown.php Outdated
Comment thread exercises/practice/markdown/Markdown.php Outdated
Comment thread exercises/practice/markdown/Markdown.php Outdated
Comment thread exercises/practice/markdown/Markdown.php Outdated
Comment thread exercises/practice/markdown/MarkdownTest.php Outdated
@Narkunan
Copy link
Copy Markdown
Contributor Author

@mk-mxp I hope I addressed everything. Please check now 😊

@Narkunan Narkunan requested a review from mk-mxp April 19, 2026 15:02
Copy link
Copy Markdown
Contributor

@mk-mxp mk-mxp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks again for the great work!

@mk-mxp mk-mxp merged commit 512de41 into exercism:main Apr 20, 2026
12 checks passed
@mk-mxp mk-mxp mentioned this pull request Apr 20, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

x:action/sync Sync content with its latest version x:knowledge/elementary Little Exercism knowledge required x:module/practice-exercise Work on Practice Exercises x:rep/small Small amount of reputation x:size/small Small amount of work x:type/content Work on content (e.g. exercises, concepts)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants